package com.example.forum.entity;

import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.util.Date;

@Data
@NoArgsConstructor
@AllArgsConstructor
@Builder
public class Article {
    private Integer id;
    private Integer userId;
    private String title;
    private String content;
    private String tag;
    private Integer categoryId;
    private Integer status;
    @JsonFormat(pattern="yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
    private Date createdAt;
    @JsonFormat(pattern="yyyy-MM-dd hh:mm:ss",timezone="GMT+8")
    private Date updateAt;

    private Boolean favorite=false;
    private Integer favoriteCount=0;
    private Boolean like=false;
    private Integer likeCount=0;
    private Integer viewCount=0;
    private String category;
    private Integer replyCount=0;

    public Article(Integer id, Integer userId, String title, String content, String tag, Integer categoryId) {
        this.id = id;
        this.userId = userId;
        this.title = title;
        this.content = content;
        this.tag = tag;
        this.categoryId = categoryId;
    }
}
